<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script>
function formSubmit()
{
document.getElementById("form1").submit();
}
</script>

<title>Untitled Document</title>
<?php
$codeInput = "";
$codeInput = $_POST['codeinput'];
$step = 0;
echo $step = $_POST['steps'];
$barcodes = "";
$barcodes = $_POST['barcodes'];
$shippingMethod = "";
$shippingMethod = $_POST['shippingmethod'];
$trackingNo = "";
$trackingNo = $_POST['trackingno'];
$packingMethod = "";
$orderNo="";
$orderNo = $_POST['orderno'];

if($codeInput =="**0BEGIN0**"){
	//Clean Everything
	$step = 0;	
	$orderNo = "";
	$barcodes="";
	$shippingMethod = "";
	$trackingNo = "";
	$packingMethod = "";
	}
elseif(
$codeInput=="**REP500**" or 
$codeInput=="**REP3KG**" or
$codeInput=="**REP5KG**" or
$codeInput=="**EXS500**" or
$codeInput=="**EXS3KG**" or
$codeInput=="**EXS5KG**" or
$codeInput=="**EXSE**"   or
$codeInput=="**FAYA2**"  or
$codeInput=="**FAYA3**"  or
$codeInput=="**FAYA5**"  or
$codeInput=="**FAYLO**"  or
$codeInput=="**REGLB**"  
	){
	$step = 3;	
	$shippingMethod = $codeInput;
	
	}
elseif(

$codeInput=="**RRAC60**" or 
$codeInput=="**RRAC120**" or 
$codeInput=="**RRAC180**" or 
$codeInput=="**RRAC300**" or 
$codeInput=="**RST60**" or 
$codeInput=="**RST12**" or 
$codeInput=="**RST18**" or
$codeInput=="**RST30**" 
){
	$step = 5;
	$shippingMethod = $codeInput;
	}
	
else
{
	echo "Not a control";
	echo "step:".$step;
	echo "POST".$_POST['steps'];
	
	if(intval($_POST['steps']) == 1){
	echo "it is order Number";	
	$orderNo = $codeInput;
	$step =1;
	}	
if(intval($_POST['steps']) == 2){
	echo "barcode I want it ";
	$orderNo = $_POST['orderno'];
	
	$barcodes = $_POST['barcodes'].",".$codeInput;
	$step = 2;
	}
if(intval($_POST['steps']) == 3){
	//$orderNo = $_POST['orderno'];
	//$barcodes = $_POST['barcodes'];
	//$shippingMethod = $codeInput;		
	$trackingNo = $codeInput;
	
	$step = 4;
	}	
if(intval($_POST['steps']) == 4){
	
	$packingMethod = $codeInput;
	}
if(intval($_POST['steps']) == 5 ){
	$packingMethod = $codeInput;
	
	}	
	
	}	
			

?>
</head>

<body>
<h1>Packing Page for Qitty889</h1>
<p>*Scan Register Label First <br />
  *Then Scan Regular Plus  Or Regular Account , you can upload with SPmothod and tracking No2 is 0<br />
  <br />
</p>
<form id="form1" name="form1" method="post" action="keeprecorder889.php">
  <label for="textfield"></label>
  <table width="1000" border="1" cellspacing="1" cellpadding="0">
    <tr>
      <td>#OrderNO.</td>
      <td>Product BarCode</td>
      <td>Shipping Method1</td>
      <td>Tracking NO1</td>
      <td>Packing Method</td>
      <td>SP Method 2</td>
      <td>Tracking No 2</td>
    </tr>
    <tr>
      <td><label for="textfield2"></label>
      <input type="text" name="order_number" id="order_number" value="<?php echo $orderNo;?>" /></td>
      <td><label for="textarea"></label>
      <textarea name="product_code" id="product_code" cols="45" rows="10"><?php echo $barcodes;?></textarea></td>
      <td><input type="text" name="ship_method" id="ship_method" value="<?php echo $shippingMethod;?>" /><br /></td>
      <td><input type="text" name="tracking_no" id="tracking_no" value="<?php echo $trackingNo;?>" /></td>
      <td><input type="text" name="packing_method" id="packing_method" value="<?php echo $packingMethod;?>"  /></td>
      <td valign="top"><input type="text" name="ship_method2" id="ship_method2" value="0"   />
 For item Over 500g
 B31 is Regular <br />
 B21 is Express<br />
 B71 is Insured Express      
      <br />
</td>
      <td valign="top"><input type="text" name="tracking_no2" id="tracking_no2" value="0"   /></td>
    </tr>    
  </table>
  <br />
<input type="button" name="button2" id="button2" value="UPLOAD" onclick="formSubmit()"/>
</form>

<form id="form2" name="form2" method="post" action="">
 <br />
Step[<?php echo $step;?>]:
<?php
switch ($step){
	case(0): {echo "Input Order No";$step=1;break;}
	case(1): {echo "Order Number Accepted, Now the barcode";$step=2;break;}
	case(2): echo "Order Number Accepted, Now the barcode";break;
	case(3): {echo "Shipping Method Selected, Now Tracking NO";break;}
	case(4): echo "Tracking Number Inputed, Now scan the Packing Method";break;
	case(5): echo "NO Tracking No NEEDED, Now scan the Packing Method";break; 
	default: echo "HELP NORMAN, Some thing is WRONG";break;	
	}
?>
<br />
<br />
 
    <input name="codeinput" type="text" id="codeinput" value="" size="50" style="font-size:24px;height:40px;" />
    <input name="steps" type="hidden" id="steps" value="<?php echo $step;?>" />
    
    <input name="orderno" type="hidden" id="orderno" value="<?php echo $orderNo;?>" />
    <input name="barcodes" type="hidden" id="barcodes" value="<?php echo $barcodes;?>" />
     <input name="shippingmethod" type="hidden" id="shippingmethod" value="<?php echo $shippingMethod;?>" />
      <input name="trackingno" type="hidden" id="trackingno" value="<?php echo $trackingNo;?>" />
    <script language="javascript">
    document.getElementById('codeinput').focus(); 
    </script> 
  
  <input type="submit" name="submit" id="button" value="ENTER" />
</form>
<pre>
<?php
var_dump($_POST);
?>
</pre>
</body>
</html>
